Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#afcd5b",
    list: [{
      pagePath: "/pages/activityIndex/activityIndex",
      iconPath: "/image/calorie/activity-grey.png",
      selectedIconPath: "/image/calorie/activity-green.png",
      text: "活动"
    }, {
      pagePath: "/pages/communityIndex/communityIndex",
      iconPath: "/image/calorie/circle-grey.png",
      selectedIconPath: "/image/calorie/circle-green.png",
      text: "圈子"
    }, {
      pagePath: "/pages/calorieIndex/calorieIndex",
      iconPath: "/image/calorie/nutrition-grey.png",
      selectedIconPath: "/image/calorie/nutrition-green.png",
      text: "食谱"
    }, {
      pagePath: "/pages/calorDailyAttendance/calorDailyAttendance",
      iconPath: "/image/calorie/punch-grey.png",
      selectedIconPath: "/image/calorie/punch-green.png",
      text: "打卡"
    }]
  },
  attached() {},
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    }
  }
})